package com.iraeta.service.hik.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.iraeta.entity.hik.HikViewcamera;
import com.iraeta.mapper.hik.HikViewcameraMapper;
import com.iraeta.service.hik.IHikViewcameraService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 海康的监控视图摄像头 服务实现类
 * </p>
 *
 * @author chenbin
 * @since 2024-01-14
 */
@Service
public class HikViewcameraServiceImpl extends ServiceImpl<HikViewcameraMapper, HikViewcamera> implements IHikViewcameraService {
    @Override
    public List<HikViewcamera> listHikViewcameraByViewId(Integer viewId) {
        QueryWrapper<HikViewcamera> qw = new QueryWrapper<>();
        qw.eq("view_id", viewId);
        return baseMapper.selectList(qw);
    }

    @Override
    public void deleteHikViewcameraByViewId(Integer viewId) {
        QueryWrapper<HikViewcamera> qw = new QueryWrapper<>();
        qw.eq("view_id", viewId);
        baseMapper.delete(qw);
    }
}
